<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'event.jsp' starting page</title>
    <link rel="stylesheet" href="css/event.css">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>


<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  </head>
  
  <body>
  
  <a href="jsp/add.jsp?term=0"> <input id="btn1" type="button" class="btn btn-primary" value="增加事件"></a>
   
   <table class="table table table-bordered">
   <tr class="tr1">
   <td>序号</td>
   <td>事件名称</td>
   <td>事件地址</td>
   <td>创建时间</td>
   <td>执行状态</td>
   <td>操作</td>
   </tr>
   <c:forEach items="${list}" var="list1"> 
  <tr>
  <td>${list1.eventId }</td>
  <td>${list1.eventName}</td>
  <td>${list1.eventAddress}</td>
  <td>${list1.eventTime}</td>
  <td>
  <c:if test="${list1.eventState==0}">未执行</c:if>
  <c:if test="${list1.eventState==1}">正在执行</c:if>
  <c:if test="${list1.eventState==2}">已完成</c:if>
  </td>
  <td>
  <c:if test="${list1.eventState==0}"><a href="showbyid.do?eid=${list1.eventId }&term=2">编辑</a>|<a href="del.do?eid=${list1.eventId }">删除</a></c:if>
  <c:if test="${list1.eventState==1}"><a href="showbyid.do?eid=${list1.eventId }&term=2">编辑</a></c:if>
  <c:if test="${list1.eventState==2}"><a href="showbyid.do?eid=${list1.eventId }&term=1">查看</a></c:if>
  </td>
  
  </tr>
    </c:forEach>
   </table>
  </body>
</html>
